//
//  FeedParser.h
//  DemoRSSReader
//
//  Created by Bruce McMoran on 7/16/11.
//  Copyright 2011 myself. All rights reserved.
//

#import <Foundation/Foundation.h>

@class FeedParser;

@protocol FeedParserDelegate <NSObject>
@optional
/*
 -(void)parserDidStart:(FeedParser*) parser;
-(void)parserDidFinish:(FeedParser*) parser;
*/

@end

@interface FeedParser : NSObject <NSXMLParserDelegate> {
@private
    id <FeedParserDelegate> delegate;
    NSXMLParser* parser;
    NSURL* feedURL;
    NSURLConnection* feedConnection;
    NSMutableDictionary* feedItem;
    NSMutableString* currentElement;
    NSMutableArray* feedItemsArray;
}

@property (nonatomic, assign) id <FeedParserDelegate> delegate;
@property (nonatomic, retain) NSXMLParser* parser;
@property (nonatomic, retain) NSURL* feedURL;
@property (nonatomic, retain) NSURLConnection* feedConnection;

@property (nonatomic, retain) NSMutableDictionary* feedItem;
@property (nonatomic, retain) NSMutableString* currentElement;
@property (nonatomic, retain) NSMutableArray* feedItemsArray;

-(id)initWithFeedURL:(NSURL*) feed;
-(BOOL) parse;

@end
